Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.06.03 15:15:00 -
[1]
Hello everyone,
during the last few days i had a look at the available PHP API Libraries, and well decided i'd be better of porting my Ruby Library (EAAL) to PHP.
so i did (mostly last night), and now its time for a first release.
you can get the library at github, you will also find a little bit of documentation there.
a few more words why i wrote this instead of using Yapeal or Ale, you can find in my Blog.
Hint: While the library works alone, it integrates very well in King23 (the framework i used for building northern-crusade).
best regards, PP
PS: you can find a page about it on the eve-dev wiki too.
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.06.04 08:29:00 -
[2]
Originally by: Johnathan Roark I haven't taken the time to look at it, but I'll see if it works better for some of my projects. I think you kind of miss the point of yapeal. Its not really a library in the traditional since. Most projects are going to take data from the API, do what ever, then that data ends up in a database. Yapeal skips directly to putting the data into a database. I do agree that documentation could be better.
i dont think that invalidates anything i said. Even with that goals it should be configureable through Code, not by ini only, and well, putting direct in the database means you have to fetch from there, process the data, and then put it down in the way you need it, its quite unlikely applications will use the data the way yapeal stores it. (and if, then i dont want to be the one optimizing it for higher loads :p)
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.06.04 13:09:00 -
[3]
Originally by: Dragonaire The only things that are in the ini is the DB user/password stuff (can't store them in the DB since they are needed to access it ) and stuff dealing with logging and caching which really doesn't need to be configure by anyone but the developer using it as a library in their application.
As a developer using it as a library i am not supposed to know how the database setup, or the pathes for caches are at the users side. i do want to offer the user a way to configure it, but i do not want him to edit ini files of libraries that he does not need to know about.
Originally by: Dragonaire You're doing something wrong if you're trying to store the data again outside the DB instead of using it directly through selects with joins etc as needed. If you're not use to DBs, which I wasn't really until a couple projects ago, you try doing stuff like that instead of letting the DB work for you. Once I learned how they can help you for things like this I'd never go back but I also know they aren't for every project either.
Cached data does not belong in the database, unprocessed data, which is stored processed in the database does not need to be there either, no point in having double the amount of data arround. Data that does not need to be processed at all - well can be served directly from the cache, being much faster than using a database inbetween.
Originally by: Dragonaire In the end it all depends on the application. For people use to developing 2-3 tier web applications Yapeal is a better fit.
No.
Originally by: Dragonaire For simple one tier ones like your talking about what you've made works well and the project that Yapeal grow out of had much the same idea but in the end didn't scale well until it move to something with a database and the more modern multiple tier model. There's always room for other ideas how to do things and hopefully some people will find Pheal useful for them in some of their projects just like many people have found Yapeal and ALE to be in many others.
i was not talking of any "simple one tier" applications at all, except you want to call the code snippets i provided as documentation "applications".
And as soon as the data you serve gets more complex, the last thing you want todo is serve complex joins straight from the database. You serve them through various ways of caching, or you kill you whole setup.
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.06.04 13:45:00 -
[4]
Originally by: Amida Ta
Or in EveAI if you need Blueprints for Products thats a single memory read. It's impossible to be more efficient than that. No matter how special-purpose your code is.
Is it?, even if i have a list of products, an exclusion list of products, and only need those that are not excluded with blueprints, but need all of 'em to be in my object tree? if this is one read, then i end up either with data that i dont use (using your generic implementation), or i do a specialised solution which removes the excluded ones from the ones requested, in a low-product count this specialised solution might add overhead, but in an environment with alot of data trading of the few cycles for having less memory usage might be the more efficient way.
either way, Catari Taga is right, this discussion does not belong into my thread, so lets keep it out of here.
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.06.04 19:18:00 -
[5]
Edited by: Peter Powers on 04/06/2010 19:18:36
Originally by: Dragonaire Right so you offer the option to configure them along with anything else you let your end users change in your application and you handle updating the ini file inside the application because they don't care what part of the code you are using needs it.
right, because writing a config file through the application is much more efficient, than using configuration which the application needs anyways. If i for example use a database, then i dont want it to be configured in two places, i want my frameworks / applications database connection data, and IF i'd agree (which i dont) with an API library writing to the database (yeah, a data import library which writes to the database directly not using my model...), then i would want my application to directly tell the library what todo, not write an additional file.
Originally by: Dragonaire I agree that if you already have it in a preprocessed/full processed state you really don't need to store the raw data too but as I found out lots of people wanted the XML cached where they could get at it so listening to my users (the application developers) I give them the option to cache the XML as files or in the DB but it's not required for Yapeal to work and can be turned off if not wanted.
Still yapeal requires acces to a database.
Originally by: Dragonaire
Originally by: Peter Powers Data that does not need to be processed at all - well can be served directly from the cache, being much faster than using a database inbetween.
If you are showing the XML directly to the user than that is true but I'm guessing you aren't doing that
No, thats why i said data that doesnt need to processed, and as i said in my statement before that, i personally think that a proper application will process the data,for example to put it in a format that fits the model.
Originally by: Dragonaire once you have to start translating all those wonderful TypeID numbers etc into names and pictures in your application using the static data dump from a DB it makes more sense to combine the API data from a DB table with it than having to process the XML on every page refresh for hundreds or thousands of items.
Yes, and thats the job of the model layer of the application, not of some data importer which has no clue at all how that Model looks.
Originally by: Dragonaire Are there ways to do it so you don't have to do that yes but once you start coding things to do that you're starting to duplicate in you application things that have already been solved by other people in all the exist caching libraries for PHP, in the web server or in effect making your own custom DB server.
you are not making any sense here, there is no existing "cache library", "web server" or "db server", which has the model logic of a new application, except you have a shared model for several applications.
Originally by: Dragonaire
Originally by: Peter Powers No.
???
i think the reason why it is NOT a good idea to use a library which comes with its own database access, its own table layouts etc. is that in modern application you want a proper model.
Originally by: Dragonaire I agree and was in effect saying much the same thing above. Simple joins on tables with good indexes don't take any extra time. If that wasn't true why would DBs have been developed to start with
pretty much because a unified way is needed to access relational data. That said, you might want to look at alternative object/document based databases, which are currently having a nice upwards trend, since they are much more efficient in storing object/document style data than most rdbms+orm based solutions.
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.06.04 19:23:00 -
[6]
Originally by: Dragonaire
You've developed Pheal/EAAL for an application/framework you've made which is much the way the code that became Yapeal started out as in an application I developed for my corp. So it was a solution to a need you had which is good and it seems you took some time to make it in a way that allowed it to be translated fairly easily from Ruby to PHP which is great
I wrote EAAL in 2008 to learn ruby, and because i wanted a library which needed very little maintenance when new pages where added to the EVE API. EAAL since then has been used for various applications, and seen contributions by several developers. At no point in the development of EAAL there was even a thought about if/how this could be ported to PHP. Why it was ported is outlined in my Blog - because there simply was no PHP Library which would work as flexible as Pheal or EAAL do for PHP. (For Python Entity wrote an awesome library which works quite similar, long before i ever looked at python, and long before i wrote EAAL).
Originally by: Dragonaire
You seem to have even made it in a general enough way that others might be able to use it as well
it was designed to stand alone, and integrate well in all sorts of environments, you use PHP5.2 in a default setup? it works, without additional libraries etc.
Originally by: Dragonaire but I'll bet the chances are once people do start using it in ways you never thought of yourself you'll find changes will need to be made.
Changes that would need to be made would be if the way the EVE API works. Stuff like writing to a database, or other cache handlers can and should simply be done userland, by design.
Originally by: Dragonaire Yapeal has been doing that every since I made it public over a year ago and continues to change as the APIs and the applications it is used in grow and change as well.
EAAL and Pheal are designed to NOT need changes when CCP adds new pages to the API, thats one of the design goals, and it works for EAAL quite well (and will for Pheal too). Its one of the things that i think where missing in Yapeal or Ale.
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.06.04 19:42:00 -
[7]
Edited by: Peter Powers on 04/06/2010 19:43:14
Originally by: Lumy
And that's why Ale allows you to pass it active database connection. Something like this:
$db = mysql_connect(...); $ale = AleFactory::getEVEOnline(array('cache.db' => $db)); For what it matters, you can define/override any value from config file in same way.
Just saying... 
actually, i didnt find that part in the Docs, probably didnt look deep enough though.. :( you should get the docs a bit more sorted, but you know that :)
Originally by: Peter Powers EAAL and Pheal are designed to NOT need changes when CCP adds new pages to the API, thats one of the design goals, and it works for EAAL quite well (and will for Pheal too). Its one of the things that i think where missing in Yapeal or Ale.
Now you hurt my feelings.
ouch, yes, i fail and take back what i said about Ale in this regard. I apologize for unintentionally spreading missinformation. you had the simplexml extending solution which actually works well in this regard. sorry again.
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.06.05 11:03:00 -
[8]
for those interested in commit notifications, you can follow "King23Framework" on Twitter http://twitter.com/King23Framework
or join the irc channel #king23 at the coldfront network (irc.coldfront.net) (whenever i do a commit to github to king23 or pheal a bot will join and announce it there)
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.06.21 08:44:00 -
[9]
Originally by: Kaylana Syi
I have both but currently really enjoying Mecurial, and it is github's main competitor. It doesn't really need to have all the change tracking, but it would be nice to be able to use the latest repo using Mecurial. I don't want you to do double work but it would be nice to get better accessibility.
Ahoy Kaylana,
first of all sorry for the late answer, im having alot of RL stuff going on atm.
personally i use git for everything i do in private (and svn at work), so i dotn really have any knowledge about mecurial, however, if you want todo that - go ahead and setup a mirror (let me know if you do), but personally i wont learn to work with mecurial for this.
If you dont want to use git, all releases are tagged, and therefor can be downloaded as tgz or zip archive on github, check http://github.com/ppetermann/pheal/downloads
regards, PP
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.07.04 11:17:00 -
[10]
since a few people have been asking me for more usage examples on pheal, i have hacked together a small project demonstrating its use, check out: http://github.com/ppetermann/king23_pheal_cli which is basically a set of King23 Tasks to get a hand full of information from the EVE API, while this example requires King23 (will be installed by using the git submodule stuff), the lines using Pheal should be understandable and useable without the King23 Framework too.
regards, PP
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.08.23 08:35:00 -
[11]
Originally by: Kelas Tovat Hi, I have been playing around with this library, it's pretty nice. I have one problem though, I have been using it on a dev server I have at home but when it gets really cold here my internet connection gets flaky, this causes a problem when the cache file is out of date and the API server can't be contacted.
I think it would be nice if you added an argument to the cache->load method that allows for forced loading of the cached file. That way if you can't load data from the API you can simply force the loading of expired data from the cache.
first of all, sorry for the late reply, second - i think the right way of doing that would be implementing a cache class which does that
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.08.24 22:04:00 -
[12]
Originally by: Kelas Tovat
I think it would be nice if you added an argument to the cache->load method that allows for forced loading of the cached file. That way if you can't load data from the API you can simply force the loading of expired data from the cache.
ok, i added a new cache variant, which is extending the regular filecache, and overriding the validation method, this way, if a cache file exists for your request then it will be used - no matter what - that should be pretty much what you asked for.
usage is simple - instead of
Originally by: "code" PhealConfig::getInstance()->cache = new PhealFileCache();
you do
Originally by: "code" PhealConfig::getInstance()->cache = new PhealFileCacheForced();
this change is available in v0.0.5, which i just pushed to github :)
best regards, PP
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.10.12 08:25:00 -
[13]
v0.0.6 is now available, which is basically a bug fix.
if the api was not reachable after the cache expired pheal would write an empty cache file and throw an Exception when trying to read that. Now it should throw a PhealException instead of writing the empty file.
thanks to wengole who found t his bug.
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.11.12 13:01:00 -
[14]
Pheal 0.0.7:
Bugfixes: - a bug with element names has been fixed (Wollari) - in some php configurations $_ENV is not available, now getenv() is used (niki)
Features - can now use curl rather then usual file getting (Wollari) - can now archive API cache (Wollari) - RowSetRows can now be casted to strings, when done so they will contain the text content of such element (Peter Powers)
For the new features feel free to read the README, i dont know if Wollari is going to add a few words to this thread.
Recommendation: Update ASAP, should be compatible.
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.11.14 11:37:00 -
[15]
Pheal 0.0.8:
Bugfixes: - caching broken in 0.0.7 fixed again (Wollari)
Recommendation: Update ASAP, should be compatible.
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet IT Alliance
|
Posted - 2010.11.24 08:16:00 -
[16]
Wollari did some more work,
Release: v0.0.9 https://github.com/ppetermann/pheal
Changes - few bug fixes / adjustments relating to rights in the filesystem - feature: logging of API calls
Recommendation Update if having errors, or needing new feature.
Northern Crusade - Daily numbers on EVE's largest current conflict |

Peter Powers
FinFleet Raiden.
|
Posted - 2011.01.31 08:25:00 -
[17]
Hey guys, after the last few weeks have been a bit silent, here is the latest release of Pheal.
Release: v0.0.13 https://github.com/ppetermann/pheal
Changes - Workarround for a bug with cachetimers (thanks Wollari) - Extended Support for https (thanks Wollari) - Support for http keep_alive (and again, thanks Wollari) - support for fluent scope settings (thanks erik)
Recommendation Upgrade, use https.
|

Peter Powers
FinFleet Raiden.
|
Posted - 2011.02.07 21:56:00 -
[18]
Wollari is killing my sleep with all his Pull requests, so now presending the next version
Release: v0.0.14 https://github.com/ppetermann/pheal
Changes now offers an toArray() method, that allows to convert pheal results to arrays (for example if you need to put 'em out as json)
Recommendation Upgrade, if you have use for toArray, otherwise you can skip version.
|

Peter Powers
FinFleet Raiden.
|
Posted - 2011.02.16 12:02:00 -
[19]
Originally by: Aglaia Adrastos I'm trying some tests to get to know this library but i gather its only me getting issues :P
Quote: Warning: SimpleXMLElement::__construct()
and a lot of them. the code I'm using is;
Quote: $pheal = new Pheal(); try { $result = $pheal->eveScope->FacWarStats(); $result = $pheal->ApiPage(); $rawxml = $pheal->xml; } catch(PhealException $e) { echo 'error: ' . $e->code . ' meesage: ' . $e->getMessage(); }
Maybe i'm miss understanding something but it caches the file fine and so on, just doesn't print the xml.
does it give you any line/file where that warning occurs?
|

Peter Powers
FinFleet Raiden.
|
Posted - 2011.02.28 23:46:00 -
[20]
Originally by: MJ Maverick Ah, damn. So basically dump the AllianceList.xml into a DB?
Is there a function in Pheal to do that? If not any ideas what the best way to do it would be and an example database structure?
no, the api library would be the wrong place to do this. the design of the database depends on what you need, and what database system you are using.
Vote Peter Powers for CSM6!
|

Peter Powers
FinFleet Raiden.
|
Posted - 2011.05.24 16:24:00 -
[21]
Originally by: MJ Maverick FYI: Strict Standards: date_default_timezone_get() [function.date-default-timezone-get]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/*****/public_html/forumapi/pheal/PhealResult.php on line 70
so, either setup date.timezone in your php.ini, set the TZ environment variable of your system, or run date_default_timezone_set in your application, its not like a library you use should change the timezone settings you have ;) Deblob! the Website with Statistics about the BFF vs. DRF+Friends. Conflict!
|

Peter Powers
FinFleet Raiden.
|
Posted - 2011.05.26 05:39:00 -
[22]
Originally by: MJ Maverick Hmm, I added
Quote: date.timezone = "Europe/London"
to php.ini (PHP v5.2.14) but I'm still getting it. :/
http://www.php.net/manual/en/datetime.configuration.php it explains how it needs to be named, what options are accepted (link to a timezone list is there). Also, have you restarted your webserver after changing the php.ini? Deblob! the Website with Statistics about the BFF vs. DRF+Friends. Conflict!
|

Peter Powers
FinFleet Raiden.
|
Posted - 2011.07.11 23:19:00 -
[23]
Originally by: Snipes2083
Quote: $sheet = $pheal->CorporationSheet(array(characterID=>$charID));
you really should put the key into quotes so it reads: $pheal->CorporationSheet(array('characterID' =>$charID));
otherwise you will get warnings on a proper setup :) wearing expensive clothes since 2011.06.24 22:03:00
|

Peter Powers
FinFleet Raiden.
|
Posted - 2011.08.31 22:31:00 -
[24]
can you please create a new issue at github, and add an example of the xml causing this? (for example from your cache directory) wearing expensive clothes since 2011.06.24 22:03:00
|
|
|